package com.example.experiment2.service.Impl;

import com.example.experiment2.entity.Student;
import com.example.experiment2.mapper.StudentMapper;
import com.example.experiment2.service.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    private StudentMapper studentMapper;

    @Override
    public List<Student> listAll() {
        return studentMapper.selectList(null);
    }

    @Override
    public Student getById(int studentId) {
        return studentMapper.selectById(studentId);
    }

    @Override
    public void add(Student student) {
        studentMapper.insert(student);
    }
}
